Radar Host Communication library  2020.08.13
get_raw_data_cnf_t Struct Reference

This struct holds all information about a single frame of radar data. More...

#include <radar_common.h>

Data Fields

const float * sample_data
 
uint32_t frame_number
 
uint32_t num_chirps
 
uint8_t num_rx_antennas
 
uint32_t num_samples_per_chirp
 
uint8_t rx_mask
 
uint8_t adc_resolution
 
uint8_t interleaved_rx
 
Rx_Data_Format_t data_format
 

Detailed Description

This struct holds all information about a single frame of radar data.

A structure of this type is returned through the callback Callback_Data_Frame_t when ep_radar_base_get_frame_data is called.

The data type of samples in sample_data depends on the ADC resolution. If adc_resolution <= 8, sample_data points to an array of uint8_t. If 8 < adc_resolution <= 16, sample_data points to an array of uint16_t. Higher ADC resolutions are currently not supported.

If the frame contains more than one chirp, the chirps are stored in consecutive data blocks. The start of each chirp can be calculated by the following formula.

frame_start = &sample_data[CHIRP_NUMBER *
((data_format == RADAR_RX_DATA_REAL)? 1 : 2)];

The index calculation of a certain data sample captured from a certain RX antenna depends on the data interleaving and on real/complex data format. The following code examples demonstrate how to access a data sample.

// interleaved_rx = 0, data_format = RADAR_RX_DATA_REAL
// --------------------------------------------------------------------
data_value = frame_start[ANTENNA_NUMBER * num_samples_per_chirp +
SAMPLE_NUMBER];
// interleaved_rx = 0, data_format = RADAR_RX_DATA_COMPLEX
// --------------------------------------------------------------------
data_value_real = frame_start[(2 * ANTENNA_NUMBER ) *
num_samples_per_chirp + SAMPLE_NUMBER];
data_value_imag = frame_start[(2 * ANTENNA_NUMBER + 1) *
num_samples_per_chirp + SAMPLE_NUMBER];
// interleaved_rx = 0, data_format = RADAR_RX_DATA_COMPLEX_INTERLEAVED
// --------------------------------------------------------------------
data_value_real = frame_start[2 * ANTENNA_NUMBER * num_samples_per_chirp +
SAMPLE_NUMBER];
data_value_imag = frame_start[2 * ANTENNA_NUMBER * num_samples_per_chirp +
SAMPLE_NUMBER + 1];
// interleaved_rx = 1, data_format = RADAR_RX_DATA_REAL
// --------------------------------------------------------------------
data_value = pFrameStart[SAMPLE_NUMBER * num_rx_antennas + ANTENNA_NUMBER];
// interleaved_rx = 1, data_format = RADAR_RX_DATA_COMPLEX
// --------------------------------------------------------------------
data_value_real = frame_start[SAMPLE_NUMBER * num_rx_antennas +
ANTENNA_NUMBER];
data_value_imag = frame_start[(num_samples_per_chirp + SAMPLE_NUMBER) *
num_rx_antennas + ANTENNA_NUMBER];
// interleaved_rx = 1, data_format = RADAR_RX_DATA_COMPLEX_INTERLEAVED
// --------------------------------------------------------------------
data_value_real = frame_start[2 * SAMPLE_NUMBER * num_rx_antennas +
ANTENNA_NUMBER];
data_value_imag = frame_start[2 * SAMPLE_NUMBER * num_rx_antennas +
ANTENNA_NUMBER + 1];

In the code examples above, ANTENNA_NUMBER does not refer to the physical antenna number, but the n-th enabled antenna. If for example rx_mask = 0xA, ANTENNA_NUMBER=0 refers to antenna 0010b and ANTENNA_NUMBER=1 refers to antenna 1000b. Furthermore it is assumed that pDataBuffer and frame_start are casted to (uint8_t*) or (uint16_t*) according to ADC resolution.

In total the data buffer contains num_chirps * num_rx_antennas * num_samples_per_chirp values. If radar data is complex, that value is multiplied by 2.

Definition at line 160 of file radar_common.h.

Field Documentation

◆ adc_resolution

uint8_t adc_resolution

The ADC resolution of the data in sample_data.

Definition at line 187 of file radar_common.h.

◆ data_format

Rx_Data_Format_t data_format

This indicates if the data is sample_data is real or complex, and if complex data is interleaved.

Definition at line 203 of file radar_common.h.

◆ frame_number

uint32_t frame_number

The running number of the data frame. The frame counter is, reset every time ep_radar_base_set_automatic_frame_trigger is called. If automatic frame trigger is not active, the frame counter may not work, and this could be 0.

Definition at line 164 of file radar_common.h.

◆ interleaved_rx

uint8_t interleaved_rx

If this is 0, the radar data of multiple RX antennas is stored in consecutive data blocks, where each block holds data of one antenna. If this is non-zero, the radar data of multiple RX antennas is stored in one data block, where for each point in time the samples from all RX antennas are stored consecutively before the data of the next point in time follows.

Definition at line 189 of file radar_common.h.

◆ num_chirps

uint32_t num_chirps

The number of chirps in this frame.

Definition at line 173 of file radar_common.h.

◆ num_rx_antennas

uint8_t num_rx_antennas

The number of RX signals that have been acquired with each chirp.

Definition at line 175 of file radar_common.h.

◆ num_samples_per_chirp

uint32_t num_samples_per_chirp

The number of samples acquired in each chirp for each enabled RX antenna.

Definition at line 178 of file radar_common.h.

◆ rx_mask

uint8_t rx_mask

Each antenna is represented by a bit in this mask. If the bit is set, the according RX antenna was used to capture data in this frame.

Definition at line 181 of file radar_common.h.

◆ sample_data

const float* sample_data

The buffer containing the radar data

Definition at line 162 of file radar_common.h.


The documentation for this struct was generated from the following file: